package org.finesys.system.api.tenant;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.finesys.common.mp.core.base.BaseEntity;

import java.util.Date;
/**
 * 租户用户表实体bean
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sys_tenant_user")
public class SysTenantUser extends BaseEntity {
    private static final long serialVersionUID = -3955131724041463333L;

    /**
     * 默认密码
     */
    @TableField(exist = false)
    public static final String DEFAULT_PASSWORD = "123456";

    // 用户ID
    @TableId(value = "user_id", type = IdType.ASSIGN_ID)
    @Schema(description = "主键id")
    private Long userId;

    // 租户ID
    @Schema(title = "租户ID")
    private Long tenantId;

    // 部门 ID
    @Schema(title = "部门ID")
    private Long deptId;

    // 用户登录名
    @Schema(title = "用户名")
    private String userName;

    // 用户密码
    @Schema(description = "密码")
    private String password;
    /**
     * 随机盐
     */
    @JsonIgnore
    @Schema(description = "随机盐")
    private String salt;
    // 用户名称
    @Schema(description = "用户名称")
    private String name;

    // 邮箱
    @Schema(description = "邮箱")
    private String email;

    // 电话
    @Schema(description = "手机号")
    private String phone;


    // 头像
    @Schema(description = "头像地址")
    private String avatar;

    // 性别
    @Schema(description = "性别")
    private String sex;

    /**
     * 状态 0锁定 1有效
     */
    @Schema(description = "状态")
    private String status;

    // 最近访问IP
    @Schema(description = "最近访问IP")
    private String loginIp;

    // 最近访问时间
    @Schema(description = "最近访问时间")
    private Date loginDate;

    // 描述
    @Schema(description = "描述")
    private String remarks;

    // 密码过期日期
    @Schema(description = "密码过期日期")
    private Date passwordExpireDate;
    // 员工号
    @Schema(description = "员工号")
    private String userSn;

    // 是否管理员
    @TableField(exist = false)
    private String isAdmin;
    /**
     * 0-正常，1-删除
     */
    @TableLogic
    private String delFlag;

}
